#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
 @Time    : 2021/1/22 下午4:43
 @Author  : tgy
 
"""
from scapy.all import *
import utils

def arp_request(ip, ifname='eth0', queue = None):
    ...
    res_raw = srp(Ether(dst='FF:FF:FF:FF:FF:FF')/ARP(op=1,hwdst='00:00:00:00:00:00',pdst=ip),timeout=1,iface=ifname,verbose=False)
    if res_raw:
        res_dic = res_raw[0].res[0][1].getlayer(ARP).fields
        return res_dic['psrc'],res_dic['hwsrc']

if __name__ == '__main__':
    ...
    # print(utils.get_ip())
    # res = arp_request(ip='10.211.55.2')
    # if res:
    #     print(res)
        

